// 针对reserve的API操作都写在这里

import service from ".";

// 将所有的针对reserve的请求，都封装到一个对象中
const reserveApi = {
    add(reserve){
        return service.post(
            '/reserve',
            reserve
        ).then(response=>response.data);
    },
    search(params){
        return service.get(
            '/reserve',
            {params: params},    // 传递参数
        ).then(response=>response.data);
    },
    edit(reserve){
        return service.put(
            '/reserve',
            reserve,
        ).then(response=>response.data);
    },
    remove(reserve){
        return service.delete(
            '/reserve',
            reserve,
        ).then(response=>response.data);
    },
    batchSign(reserves){
        return service.put(
            '/reserve/batchSign',
            reserves,
        ).then(response=>response.data);
    }
};

export default reserveApi;